package com.xhai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 登录日志表
 * </p>
 *
 * @author xhai
 * @since 2025-05-24
 */
@Getter
@Setter
@ToString
@TableName("sys_login_log")
@Schema(name = "SysLoginLog", description = "登录日志表")
public class SysLoginLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 登录日志ID
     */
    @Schema(description = "登录日志ID")
    @TableId(value = "LOGIN_LOG_ID", type = IdType.ASSIGN_ID)
    private Long loginLogId;

    /**
     * 登录IP
     */
    @TableField("IP")
    @Schema(description = "登录IP")
    private String ip;

    /**
     * 登录地点
     */
    @TableField("LOCATION")
    @Schema(description = "登录地点")
    private String location;

    /**
     * 浏览器类型
     */
    @TableField("BROWSER")
    @Schema(description = "浏览器类型")
    private String browser;

    /**
     * 操作系统
     */
    @TableField("OS")
    @Schema(description = "操作系统")
    private String os;

    /**
     * 登陆时间
     */
    @TableField("LOGIN_TIME")
    @Schema(description = "登陆时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime loginTime;

    /**
     * 登录账号
     */
    @Schema(description = "登录账号")
    @TableField("LOGIN_USERNAME")
    private String loginUsername;

    /**
     * 登录结果（0失败，1成功）
     */
    @TableField("LOGIN_RESULT")
    @Schema(description = "登录结果（0失败，1成功）")
    private String loginResult;

    /**
     * 登录提示消息
     */
    @TableField("MSG")
    @Schema(description = "登录提示消息")
    private String msg;
}
